package circle9_1_1_1;

public class Circle {
	private double radius = 1.0;
	private String color = "red";

	public Circle() {
		super();
	}

	public Circle(double radius) {
		super();
		this.radius = radius;
	}

	public Circle(double radius, String color) {
		super();
		this.radius = radius;
		this.color = color;
	}

	public double getRadius() {
		return radius;
	}

	public void setRadius(double radius) {
		this.radius = radius;
	}

	public String getColor() {
		return color;
	}

	public void setColor(String color) {
		this.color = color;
	}

	@Override
	public int hashCode() {
		return color.hashCode() + Double.hashCode(radius);
	}

	@Override
	public boolean equals(Object obj) {
		if (!(obj instanceof Circle))
			return false;
		Circle circle = (Circle) obj;
		return this.color == circle.color && this.radius == circle.radius;
	}

	@Override
	public String toString() {
		return "Circle [radius=" + radius + ", color=" + color + "]";
	}

	public double getArea() {
		return Math.PI * radius * radius;
	}

	public double getCircumference() {
		return Math.PI * 2 * radius;
	}
}
